forked from stadelmanma/tree-sitter-fortran
-
Notifications
You must be signed in to change notification settings - Fork 0
Merge tree-sitter-fortran
#12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
inaki-amatria
merged 38 commits into
codee
from
feature/FinalUpgradeTreeSitterFortranAuto
Jun 25, 2025
Merged
Merge tree-sitter-fortran
#12
inaki-amatria
merged 38 commits into
codee
from
feature/FinalUpgradeTreeSitterFortranAuto
Jun 25, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously, `end program` would be captured as: end_program_statement "endprogram" "endprogram" and now it will be captured as: end_program_statement "end" "program"
Split the aliasing of `end` statements
Previously: ```f90 print*, 'this looks like implicit '& 'concatenation but isn''t' print*, "this explicit concatenation "& // "is intended" ``` would get parsed as ``` 8:2 - 9:33 print_statement 8:2 - 8:7 "print" 8:7 - 8:8 format_identifier 8:7 - 8:8 "*" 8:8 - 8:9 "," 9:7 - 9:33 output_item_list 9:7 - 9:33 string_literal `'concatenation but isn''t'` 10:2 - 11:23 print_statement 10:2 - 10:7 "print" 10:7 - 10:8 format_identifier 10:7 - 10:8 "*" 10:8 - 10:9 "," 11:7 - 11:23 output_item_list 11:7 - 11:23 concatenation_expression 11:7 - 11:7 left: string_literal 11:7 - 11:9 "//" 11:10 - 11:23 right: string_literal `"is intended"` ``` Note first half of literal is missing! Now gets parsed as: ``` 8:2 - 9:33 print_statement 8:2 - 8:7 "print" 8:7 - 8:8 format_identifier 8:7 - 8:8 "*" 8:8 - 8:9 "," 8:10 - 9:33 output_item_list 8:10 - 9:33 string_literal 8:10 - 8:39 `'this looks like implicit '&\n` 9:10 - 9:33 ` 'concatenation but isn''t'` 10:2 - 11:23 print_statement 10:2 - 10:7 "print" 10:7 - 10:8 format_identifier 10:7 - 10:8 "*" 10:8 - 10:9 "," 10:10 - 11:23 output_item_list 10:10 - 11:23 concatenation_expression 10:10 - 10:40 left: string_literal `"this explicit concatenation "` 10:40 - 10:41 "&" 11:7 - 11:7 "&" 11:7 - 11:9 "//" 11:10 - 11:23 right: string_literal `"is intended"` ``` Full literal text is now included. No tests because this is in the CST, and that's not captured in the tests
Fixes stadelmanma#134 Fixes stadelmanma#136 Fixes stadelmanma#139
Previously these were parsed as standalone `call_expression`s, but the previous change made these ungrammatical.
Previously were just `call_expression`
Also allows parsing `foo()` as a standalone statement, which could be a compiler extension or preprocessor macro
`mark_end` has to be used with `advance` rather than `skip`, or the text isn't captured properly in the CST (although the named node may still exist) Closes stadelmanma#146
Moving the `_end_of_statement` out of each rule into `_specification_part` reduces the total number of states and makes it slightly faster to generate the grammar. Also means that the newline isn't included in the node itself
…l-continuation Fix string literals immediately followed by line continuation
…er-keyword-clashes Fix more keyword/identifier clashes
Add supertypes
Allows capturing common block name
It turns out that Fortran allows the `fmt` argument to IO routines as the second argument without `fmt=`, even if the first argument _does_ have `unit=` Closes stadelmanma#40
More extensions and edge cases
Fix wait and flush not appearing as `file_position_statement`
More extensions
d-alonso
approved these changes
Jun 23, 2025
ruifm
approved these changes
Jun 23, 2025
We decided to squash all commits and merge this change to bypass the current restriction preventing merge commits on the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates our fork of
tree-sitter-fortran
to incorporate the latest changes from upstream.The update was reviewed in: #11.